﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.ComponentModel;

namespace MovieApp.Models
{
    [MetadataType(typeof(Movie_Validation))]
    public partial class Movie
    {
        // Partial class compiled with code produced by VS designer
    }
    
    
    //[Bind(Exclude="ID")]
    public class Movie_Validation
    {
        [Required(ErrorMessage="Title Required")]
        [StringLength(50,ErrorMessage="Must be under 50 characters")]
        public string Title { get; set; }

        public string Director { get; set; }

        [DisplayName("My Field")]
        public DateTime YearReleased { get; set; }

        [Range(0,5,ErrorMessage="Rating must be between 0 and 5")]
        public int Rating { get; set; }
    }
}